<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Table</title>

    <!-- Styles -->
    <link href="assets/css/lib/font-awesome.min.css" rel="stylesheet">
    <link href="assets/css/lib/themify-icons.css" rel="stylesheet">
    <link href="assets/css/lib/menubar/sidebar.css" rel="stylesheet">
    <link href="assets/css/lib/bootstrap.min.css" rel="stylesheet">
    <link href="assets/css/lib/helper.css" rel="stylesheet">
    <link href="assets/css/style.css" rel="stylesheet">
</head>

<body>

<div class="sidebar sidebar-hide-to-small sidebar-shrink sidebar-gestures">
    <div class="nano">
        <div class="nano-content">
            <div class="logo"><a href="index.html">
                <!-- <img src="assets/images/logo.png" alt="" /> --><span>医疗管理系统</span></a></div>
            <ul>
                <li><a class="sidebar-sub-toggle"><i class="ti-layout-grid4-alt"></i> 医疗管理 <span
                        class="sidebar-collapse-icon ti-angle-down"></span></a>
                    <ul>
                        <li><a href="yl-index.html">科室管理</a></li>
                        <li><a href="yl-yisheng.html">医生管理</a></li>
                        <li><a href="yl-huanzhe.html">患者管理</a></li>
                        <li><a href="yl-chuangwei.html">床位查询</a></li>
                    </ul>
                </li>

            </ul>
        </div>
    </div>
</div>
<!-- /# sidebar -->


<div class="header">
    <div class="container-fluid">
        <div class="row">
            <div class="col-lg-12">
                <div class="float-left">
                    <div class="hamburger sidebar-toggle">
                        <span class="line"></span>
                        <span class="line"></span>
                        <span class="line"></span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<div class="content-wrap">
    <div class="main">
        <div class="container-fluid">
            <div class="row">
                <div class="col-lg-8 p-r-0 title-margin-right">
                    <div class="page-header">
                        <div class="page-title">
                            <h1>Hello, <span>Welcome Here</span></h1>
                        </div>
                    </div>
                </div>
                <!-- /# column -->
                <div class="col-lg-4 p-l-0 title-margin-left">
                    <div class="page-header">
                        <div class="page-title">

                        </div>
                    </div>
                </div>
                <!-- /# column -->
            </div>
            <!-- /# row -->
            <section id="main-content">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="card">
                            <div class="card-title">
                                <h4>床位查询 </h4>

                            </div>
                            <div class="card-body">
                                <div class="table-responsive">
                                    <table id="table" class="table">
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- /# row -->
                <script type="text/javascript" src="jquery-1.8.3.min.js"></script>
                <script>
                    $.ajax({
                        url: "bunk/selectBunk",
                        type: "post",
                        async: false,
                        cache: false,
                        dataType: "json",
                        "success": function (json) {
                            console.log(json)
                            var var1 = '';
                            var1 = var1 + '<tr>';
                            var1 = var1 + '<th>#</th>';
                            var1 = var1 + '<th style="text-align: center">床位名称</th>';
                            var1 = var1 + '</tr>';
                            for (var i = 0; i < json.length; i++) {
                                var obj = json[i];
                                var1 = var1 + '<tr>';
                                var1 = var1 + '<td>' + (i+1) + '</td>';
                                var1 = var1 + '<td style="text-align: center">' + obj.bunkNumber + '</td>';
                                var1 = var1 + '</tr>';
                            }
                            console.log(var1)
                            $("#table").html(var1);
                        }
                    })
                </script>

            </section>
        </div>
    </div>
</div>


<!-- jquery vendor -->
<script src="assets/js/lib/jquery.min.js"></script>
<script src="assets/js/lib/jquery.nanoscroller.min.js"></script>
<!-- nano scroller -->
<script src="assets/js/lib/menubar/sidebar.js"></script>
<script src="assets/js/lib/preloader/pace.min.js"></script>
<!-- sidebar -->

<!-- bootstrap -->
<script src="assets/js/lib/bootstrap.min.js"></script>
<script src="assets/js/scripts.js"></script>
<!-- scripit init-->


</body>

</html>
